/**
 * 
 */
package masml2jade.agents;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

import masml2jade.AgentRole;
import masml2jade.Environment;
import masml2jade.Goal;
import masml2jade.behaviour.ReativoBehaviour;

import jade.core.Agent;

/**
 * @author Administrator
 *
 */
public abstract class GoalAgent extends ModelAgent {
	
	// Goal List
	private Hashtable<String, Goal> goals = new Hashtable<String, Goal>();
	
	protected GoalAgent(Environment environment, AgentRole agentRole) {
		super(environment, agentRole);
		initialize();
	}
	
	// Goals
	public Goal getGoal(String key) {
		return goals.get(key);
	}
	public void addGoal(String key, Goal goal) {
		goals.put(key, goal);
	}
	public Goal removeGoal(String key) {
		return goals.remove(key);
	}
	public void removeAllGoals() {
		goals.clear();
	}
	public Hashtable<String, Goal> getAllGoals() {
		return goals;
	}
	
	// Put agent initializations here
	  protected void setup() {
		  // Papel de agente
		  ReativoBehaviour behaviour = new ReativoBehaviour();
		  this.addBehaviour(behaviour);
		  
	  }
	
	  // Put agent clean-up operations here
	  protected void takeDown() {
		  
	  }
	  
	  protected void formulateGoalFunction() {
	  }
	  
	  protected void formulateProblemFunction() {
	  }
	  
	  @Override
		protected abstract void initialize() ;
}
